package com.netease;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import com.netease.Kitchen;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//import org.apache.log4j.Logger;

public class NoodlesServlet extends HttpServlet
{
	//private static Logger log = Logger.getLogger(Test.class.getClass());
	protected void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException{
		PrintWriter writer=response.getWriter();
		
		String vegetable=request.getParameter("vegetable");
		
		if(vegetable==null){
			vegetable="Tomato";
		}
		
		//log.error(vegetable+"\n");
		String dateStr=new Date().toString();
		writer.println("<html><body>");
		writer.println("<h1> Noodles with "+vegetable+"</h1>");
		writer.println("<h1>Enjoy your time!</h1>");		
		writer.println("<h1>"+dateStr+"</h1>");
		writer.println("</body></html>");

		//String noodleStr=Kitchen.makeNoodles(vegetable);
		//writer.println(noodleStr);
	}
}